#include <cstdio>
#include <cstdlib>
using namespace std;

#define TIME_LENGTH 9
#define YEAR_LENGTH 5
#define MONTH_LENGTH 3
#define DAY_LENGTH 3

int CalculateDays(int, int, int);
int DiffDays(int, int, int, int);

int main()
{
    char a[TIME_LENGTH], b[TIME_LENGTH];
    while (scanf("%s %s", a, b) != EOF) {
        int a_year = atoi(a) / 10000;
        int a_month = (atoi(a) % 10000) / 100;
        int a_day = atoi(a) % 100;
        int b_year = atoi(b) / 10000;
        int b_month = (atoi(b) % 10000) / 100;
        int b_day = atoi(b) % 100;

        int a_number_day_in_year = CalculateDays(a_year, a_month, a_day);
        int b_number_day_in_year = CalculateDays(b_year, b_month, b_day);

        int diff_days = 0;
        if (atoi(a) < atoi(b))
            diff_days = DiffDays(a_year, a_number_day_in_year, b_year, b_number_day_in_year);
        else
            diff_days = DiffDays(b_year, b_number_day_in_year, a_year, a_number_day_in_year);
        printf("%d\n", diff_days);
    }

    return 0;
}

int CalculateDays(int year, int month, int day)
{
    int month_day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    if (year % 4 == 0 && year % 100 != 0) 
        month_day[1] = 29;
    if (year % 400 == 0)
        month_day[1] = 29;

    int number_days = 0;
    for (int i = 0; i < month - 1; i++)
        number_days += month_day[i];
    return number_days + day;
}

int DiffDays(int a_year, int a_days, int b_year, int b_days)
{
    int diff_days = 0;
    for (int i = a_year; i < b_year; i++) {
        if (i % 4 == 0 && i % 100 != 0)
            diff_days += 366;
        else if (i % 400 == 0)
            diff_days += 366;
        else
            diff_days += 365;
    }
    return diff_days - a_days + b_days + 1;
}

